<?php
namespace App\Services\Register;

use App\Services\Register\ValidateRegister;
use App\Services\Register\Register\RegisterLogic;


class Register
{
    // 注册
    public function register($data)
    {
        if ($data['type'] == 1) {
            ValidateRegister::checkValidate($data, ['real_name', 'phone', 'baidu', 'stage_name', 'provice', 'major', 'links']);
        }
        if ($data['type'] == 2) {
            ValidateRegister::checkValidate($data, ['team', 'phone', 'baidu', 'provice', 'links', 'phone_name', 'phone_stage', 'phone_major']);
        }
        if ($data['type'] == 3) {
            ValidateRegister::checkValidate($data, ['real_name', 'phone', 'stage_name', 'provice', 'operate']);
        }
        if ($data['type'] == 4) {
            ValidateRegister::checkValidate($data, ['team', 'phone_name', 'business', 'phone', 'company_business', 'copyright_number', 'provice', 'society_code']);
        }
        return (new RegisterLogic())->register($data);
    }

    // 编辑
    public function edit($data)
    {
        return (new RegisterLogic())->edit($data);
    }
}
